package taskmaster.job;

import NewTmas.FramesandPanels.OpsModeMainFrame;

import java.util.HashMap;

/**
 * Created by IntelliJ IDEA.
 * User: jhauser
 * Date: Jul 12, 2011
 * Time: 10:10:29 AM
 * To change this template use File | Settings | File Templates.
 */
public class TaskStatus
{
    private int statusId;
    private String statusName;
    private String statusCategory;
    private String color;

    private HashMap<String,String> category_color=new HashMap<String, String>(){
        {

            put("error","red");//red for error
            put("completed","green");//green for succeeded
            put("running","gray");//gray for running
            put("notYetRun","white");//white for notYetRun

        }
    };

    public int getStatusId() {
        return statusId;
    }

    public String getStatusName() {
        return statusName;
    }

    public String getStatusCategory() {
        return statusCategory;
    }

    public String getColor() {
        return color;
    }



    public void changeStatusto(int statusId){
        this.statusId= statusId;
        this.statusCategory= OpsModeMainFrame.status_category.get(statusId);
        this.statusName=OpsModeMainFrame.status_name.get(statusId);
        this.color= category_color.get(statusCategory);
    }

    public TaskStatus(int statusId)
    {
        this.statusId = statusId;
        this.statusName = OpsModeMainFrame.status_name.get(statusId);
        this.statusCategory = OpsModeMainFrame.status_category.get(statusId);
        this.color=category_color.get(statusCategory);

    }
}
